<?php
namespace Common\Model;
use Think\Model;

class SessionModel extends Model {
	
	public function update($data = array()){
		$session = $this -> find(session_id());
		if ($session) {
			$result = $this -> where(array('session_id' => session_id())) -> save($data);
		} else {
			$data['session_id'] = session_id();
			$result = $this -> add($data);
		}
		
		return $result;
	}
	
}